import fetch from '../config/fetch'

const pageSize = 10;
// -------------------上传视频-------------------

/**
 * 获取某一个视频产品的购买用户列表
 */
export const setLogistics = (id, logisticsNumber) => fetch({
  url: '/course/v1/' + id + '/setLogisticsStatus ',
  method: "put",
  data: JSON.stringify({ logisticsNumber: logisticsNumber, status: 'SEND' })
});

/**
 * 获取某一个专栏的购买用户列表
 */
export const getProductAllVideo = (productId, pageNumber) => fetch({
  url: '/album/v1/' + productId + '/buyUsers',
  method: "get",
  data: { pageNumber: pageNumber, pageSize }
});

/**
 * 获取视频—分页
 */
export const getAllVideo = (pageNumber) => fetch({
  url: '/album/v1/owner/page',
  method: "get",
  data: { pageNumber: pageNumber, pageSize }
});

/**
 * 获取视频—分页
 */
export const getAllCourse = (albumId, pageNumber) => fetch({
  url: '/course/org/v1/owner/page',
  method: "get",
  data: { pageNumber: pageNumber, pageSize, albumId: albumId }
});

/**
 * 删除某一个视频
 */
export const deleteVideo = (id) => fetch({
  url: '/album/v1/' + id,
  method: "delete",
  data: {}
});

// 修改某一个视频
export const updateAlbum = (id, data) => fetch({
  url: '/album/v1/' + id,
  method: "put",
  data: JSON.stringify(data)
});

// 获取单个视频信息
export const getVideo = (id) => fetch({
  url: '/album/v1/' + id,
  method: "get",
  data: {}
});

//上传视频
export const uploadVideo = (id) => fetch({
  url: '/course/org/v1/uploadVideo/' + id,
  method: "post",
  data: {}
});

// 上传视频封面
export const uploadCover = (id) => fetch({
  url: '/course/v1/uploadCover',
  method: "post",
  data: {}
});

// 创建专栏 
export const createAlbum = (data) => fetch({
  url: '/album/v1',
  method: "post",
  data: data
});

// -------------------上传视频-------------------
